﻿@model  smartcrm.Models.WorkFlowDetailModel

<script src="../../Scripts/workflowdetail.js"></script>

 
<canvas id="canvas" height="300" style="background-color:#FFFFFF;border: 2px gray solid" ></canvas>
 


<div class="list">
<div class="FL" style="display:inline; margin-top:15px"><span class="tableTitle">工作流：@Model.WorkFlowName</span></div>
    <div class="FR">
        <input type="button" value="新增" id="btnNew" />
        <input type="button" value="返回" id="btnReturn" onclick="javascript:location.href='/System/WorkFlow'" />
    </div>
    
    <table id="tWorkFlowDetail" style="clear:left">
    <thead>
    <tr>
    <th style="width:5%">序号</th>
    <th style="width:10%">步骤名称</th>
    <th style="width:10%">状态名称</th>
    <th style="width:42%">经办人员</th>    
    <th style="width:25%">后续步骤</th>
    <th style="width:6%">操作</th>
    </tr>
    </thead>
    <tbody>
    @foreach (var item in Model.Steps)
            {
                <tr>
                    <td>@item.SN </td>     
                    <td>@item.WorkFlowStepName</td>
                    <td>@item.StatusName</td>    
                    <td>                
                    @foreach (smartcrm.Models.ListOption s in item.Users)
                    {
                        <div style="margin-right:5px;float:left;">@s.OptionText,</div>
                    }
                    </td>
                     <td>                
                    @foreach (smartcrm.Models.ListOption s in item.FollowUps)
                    {
                        <div style="margin-right:5px;float:left;">@s.OptionText,</div>
                    }
                    </td>
                    <td>         

                        <img src="../../Images/grid/edit.png" title="编辑" onclick="javascript:EditStep('@item.WorkFlowStepNo')" />
                        @if (!item.IsSystemReserved)
                        {
                            <img src="../../Images/grid/delete.png" title="删除"  onclick="javascript:DeleteStep('@item.WorkFlowStepNo')" /> 
                        }
                    </td>
                </tr>
            }
    </tbody>
    </table>
</div>


<div id="divStep" title="流程步骤" style="display:none">      
    <div id="divStepContent" style="overflow-y: auto; height: 520px;">          
       <form id="formStep">        
            <table class="font85 tableEdit">  
                 <tr>
                    <td class="label">步骤名称</td>
                    <td>
                        @Html.TextBox("WorkFlowStepName", null, new { maxlength = "50" })&nbsp;<span class="redStar">*</span>                                                                   
                    </td>
                </tr>               
                <tr>
                    <td class="label">流程序号</td>
                    <td>
                        @Html.TextBox("SN", null, new { maxlength = "50" })&nbsp;<span class="redStar">*</span>                                                                   
                    </td>
                </tr>                 
                 <tr>
                    <td class="label">步骤状态</td>
                    <td>
                        @Html.DropDownList("StatusNo", new SelectList(Model.DdlOrderStatus, "ItemValue", "ItemText"))&nbsp;<span class="redStar">*</span>                                              
                    </td>
                </tr>       
                <tr>
                    <td class="label">后续步骤</td>
                    <td>
                        <table class="font85">
                            <thead>
                                <tr>
                                    <th>可用步骤</th>
                                    <th></th>
                                    <th>后续步骤</th>                    
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <select style="width:160px; height:100px;" id="aFollowUp" multiple="multiple" size="24"/>                        
                                    </td>
                                    <td>
                                        <input type="button" value="添加-&gt;" id="btnAddStep" />
                                        <br />
                                        <input type="button" value="&lt;-移除" id="btnRemoveStep" />
                                    </td>
                                    <td>
                                    <select style="width:160px; height:100px;" id="bFollowUp" multiple="multiple" size="24"></select>
                                    </td>
                                </tr>
                            </tbody>
                        </table> 
                    </td>
                </tr>          
                 <tr>
                    <td class="label">经办人员</td>
                    <td>
                        <table class="font85">
                            <thead>
                                <tr>
                                    <th>可用人员</th>
                                    <th></th>
                                    <th>经办人员</th>                    
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <select style="width:160px; height:200px;" id="aUser" multiple="multiple" size="24"/>                        
                                    </td>
                                    <td>
                                        <input type="button" value="添加-&gt;" id="btnAddUser" />
                                        <br />
                                        <input type="button" value="&lt;-移除" id="btnRemoveUser" />
                                    </td>
                                    <td>
                                    <select style="width:160px; height:200px;" id="bUser" multiple="multiple" size="24"/>
                                    </td>
                                </tr>
                            </tbody>
                        </table> 
                    </td>
                </tr> 
            </table>           
        </form>
    </div>  
    <div style="text-align:right;">  
      <span id="errorMessage" class="errorSpan"></span>    
      <input type="button" id="btnSave" value="保存" />
      <input type="button" id="btnCancel" value="取消" />    
      <input type="hidden" id="WorkFlowStepNo" />
      @Html.Hidden("WorkFlowNo")
    </div>  
</div>  